#include "../entities.hpp"


using lms::entities::Book;

Book::Book()
{
     this->title = "";
     this->author = "";
     this->isbn = "";
     this->editor = "";
     this->category = "";            
}
              
Book::Book(string title, string author, string isbn, string editor, string category,double price )
{
     this->title = title;
     this->author = author;
     this->isbn = isbn;
     this->editor = editor;
     this->category = category;                 
     this->price = price;
}

string Book::getTitle()
{
     return title;
}

string Book::getAuthor()
{
     return author;        
}

string Book::getIsbn()
{
     return isbn;  
}

string Book::getEditor()
{
     return editor;       
}

string Book::getCategory()
{
     return category;       
}

double Book::getPrice()
{
    return price;
}
              
void Book::setTitle(string title)
{
     this->title = title;      
}

void Book::setAuthor(string author)
{
     this->author = author;    
}

void Book::setIsbn(string isbn)
{
     this->isbn = isbn;      
}

void Book::setEditor(string editor)
{
     this->editor = editor;     
}

void Book::setCategory(string category)
{
     this->category = category;     
}

void Book::setPrice( double price )
{
    this->price = price;
}

Book::operator  serializable()
{
    Book::serializable serial;
    
    strcpy( serial.title,this->title.c_str() );
    strcpy( serial.isbn, this->isbn.c_str() );
    strcpy( serial.editor,this->editor.c_str() );
    strcpy( serial.category,this->category.c_str() );
    strcpy( serial.author,this->author.c_str() );
    serial.price = price;
    
    return serial;
    
}
